// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** addFarmers POST /api/farmers/add */
export async function addFarmersUsingPost(
  body: API.FarmersAddRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>('/api/farmers/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** deleteFarmers POST /api/farmers/delete */
export async function deleteFarmersUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/farmers/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** editFarmers POST /api/farmers/edit */
export async function editFarmersUsingPost(
  body: API.FarmersEditRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/farmers/edit', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** getFarmersVOByUserId GET /api/farmers/get/${param0} */
export async function getFarmersVoByUserIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getFarmersVOByUserIdUsingGETParams,
  options?: { [key: string]: any }
) {
  const { userId: param0, ...queryParams } = params
  return request<API.BaseResponseFarmersVO_>(`/api/farmers/get/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** getLoginFarmersVO GET /api/farmers/get/loginFarmer */
export async function getLoginFarmersVoUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseFarmersVO_>('/api/farmers/get/loginFarmer', {
    method: 'GET',
    ...(options || {}),
  })
}

/** getFarmersVOById GET /api/farmers/get/vo */
export async function getFarmersVoByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getFarmersVOByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseFarmersVO_>('/api/farmers/get/vo', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** listFarmersByPage POST /api/farmers/list/page */
export async function listFarmersByPageUsingPost(
  body: API.FarmersQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageFarmers_>('/api/farmers/list/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** listFarmersVOByPage POST /api/farmers/list/page/vo */
export async function listFarmersVoByPageUsingPost(
  body: API.FarmersQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageFarmersVO_>('/api/farmers/list/page/vo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** updateFarmers POST /api/farmers/update */
export async function updateFarmersUsingPost(
  body: API.FarmersUpdateRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/farmers/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
